import Cookies from 'js-cookie'
import store from './store'

const TokenKey = 'vue_admin_template_token'
const UserCode = 'v_code'
const UserMenu = 'v_menu'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setCode(code) {
  return store.set(UserCode, code)
}

export function getCode() {
  return store.get(UserCode)
}

export function removeCode() {
  return store.del(UserCode)
}

export function setMenu(menu) {
  return store.set(UserMenu, menu)
}

export function getMenu() {
  return store.get(UserMenu)
}

export function removeMenu() {
  return store.del(UserMenu)
}
